package com.kgo.demo.log;

import cn.hutool.core.date.DateUtil;
import cn.hutool.cron.CronUtil;
import cn.hutool.cron.task.Task;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class CreateLog {
    private static Logger log = LoggerFactory.getLogger(CreateLog.class);
    public static void main(String[] args) {
        CronUtil.schedule("*/2 * * * * *", new Task() {
            @Override
            public void execute() {
                log.debug("Create log {} " , DateUtil.now());
            }
        });
        CronUtil.setMatchSecond(true);
        CronUtil.start();

    }
}
